home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 12 - 1996 / 12.04 Apr 96 / ThreadingAppleEvents.sit / ThreadingAppleEvents / Grant's CGI Code 1.0b13 / Startup / Startup.c next >
MacBinary  |  1996-01-26  |  11.9 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri Jan 26 00:01:51 1996, modified Fri Jan 26 00:01:51 1996, creator 'CWIE', type ASCII, 11428 bytes "Startup.c" , at 0x2d24 454 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 53 74 61 72 74 75 | 70 2e 63 00 00 00 00 00 |..Startu|p.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 2c a4 00 | 00 01 c6 ad 2e 10 bf ad |.....,..|........|
|00000060| 2e 10 bf 00 00 04 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 84 ad 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 0d 20 | 2a 0d 20 2a 09 53 74 61 |/*****. |*. *.Sta|
|00000090| 72 74 75 70 2e 63 0d 20 | 2a 0d 20 2a 09 49 66 20 |rtup.c. |*. *.If |
|000000a0| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 65 78 63 6c |you want| to excl|
|000000b0| 75 64 65 20 43 47 49 20 | 6f 72 20 4c 69 73 74 53 |ude CGI |or ListS|
|000000c0| 54 41 52 20 73 75 70 70 | 6f 72 74 2c 20 72 65 6d |TAR supp|ort, rem|
|000000d0| 6f 76 65 20 74 68 65 20 | 61 70 70 72 6f 70 72 69 |ove the |appropri|
|000000e0| 61 74 65 20 6c 69 6e 65 | 73 0d 20 2a 09 66 72 6f |ate line|s. *.fro|
|000000f0| 6d 20 74 68 65 20 27 53 | 74 61 72 74 75 70 41 70 |m the 'S|tartupAp|
|00000100| 70 6c 69 63 61 74 69 6f | 6e 27 20 66 75 6e 63 74 |plicatio|n' funct|
|00000110| 69 6f 6e 2e 0d 20 2a 0d | 20 2a 09 54 68 69 73 20 |ion.. *.| *.This |
|00000120| 69 73 20 61 20 73 75 70 | 70 6f 72 74 20 66 69 6c |is a sup|port fil|
|00000130| 65 20 66 6f 72 20 22 47 | 72 61 6e 74 27 73 20 43 |e for "G|rant's C|
|00000140| 47 49 20 46 72 61 6d 65 | 77 6f 72 6b 22 2e 0d 20 |GI Frame|work".. |
|00000150| 2a 09 50 6c 65 61 73 65 | 20 73 65 65 20 74 68 65 |*.Please| see the|
|00000160| 20 6c 69 63 65 6e 73 65 | 20 61 67 72 65 65 6d 65 | license| agreeme|
|00000170| 6e 74 20 74 68 61 74 20 | 61 63 63 6f 6d 70 61 6e |nt that |accompan|
|00000180| 69 65 73 20 74 68 65 20 | 64 69 73 74 72 69 62 75 |ies the |distribu|
|00000190| 74 69 6f 6e 20 70 61 63 | 6b 61 67 65 0d 20 2a 09 |tion pac|kage. *.|
|000001a0| 66 6f 72 20 6c 69 63 65 | 6e 73 69 6e 67 20 64 65 |for lice|nsing de|
|000001b0| 74 61 69 6c 73 2e 0d 20 | 2a 0d 20 2a 09 43 6f 70 |tails.. |*. *.Cop|
|000001c0| 79 72 69 67 68 74 20 a9 | 31 39 39 35 20 62 79 20 |yright .|1995 by |
|000001d0| 47 72 61 6e 74 20 4e 65 | 75 66 65 6c 64 0d 20 2a |Grant Ne|ufeld. *|
|000001e0| 09 67 72 61 6e 74 40 61 | 63 6d 2e 63 6f 6d 0d 20 |.grant@a|cm.com. |
|000001f0| 2a 09 68 74 74 70 3a 2f | 2f 61 72 70 70 31 2e 63 |*.http:/|/arpp1.c|
|00000200| 61 72 6c 65 74 6f 6e 2e | 63 61 2f 67 72 61 6e 74 |arleton.|ca/grant|
|00000210| 2f 0d 20 2a 0d 20 2a 2a | 2a 2a 2a 2f 0d 0d 23 69 |/. *. **|***/..#i|
|00000220| 6e 63 6c 75 64 65 20 22 | 4d 79 43 6f 6e 66 69 67 |nclude "|MyConfig|
|00000230| 75 72 61 74 69 6f 6e 2e | 68 22 0d 0d 23 69 6e 63 |uration.|h"..#inc|
|00000240| 6c 75 64 65 20 3c 54 68 | 72 65 61 64 73 2e 68 3e |lude <Th|reads.h>|
|00000250| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 54 72 61 70 73 |.#includ|e <Traps|
|00000260| 2e 68 3e 0d 0d 23 69 6e | 63 6c 75 64 65 20 22 63 |.h>..#in|clude "c|
|00000270| 6f 6d 70 69 6c 65 72 5f | 73 74 75 66 66 2e 68 22 |ompiler_|stuff.h"|
|00000280| 0d 23 69 6e 63 6c 75 64 | 65 20 22 63 6f 6e 73 74 |.#includ|e "const|
|00000290| 61 6e 74 73 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |ants.h".|#include|
|000002a0| 20 22 67 6c 6f 62 61 6c | 73 2e 68 22 0d 0d 23 69 | "global|s.h"..#i|
|000002b0| 6e 63 6c 75 64 65 20 22 | 41 62 6f 75 74 42 6f 78 |nclude "|AboutBox|
|000002c0| 2e 68 22 0d 23 69 6e 63 | 6c 75 64 65 20 22 41 45 |.h".#inc|lude "AE|
|000002d0| 46 75 6e 63 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |Func.h".|#include|
|000002e0| 20 22 41 45 48 61 6e 64 | 6c 65 72 73 2e 68 22 0d | "AEHand|lers.h".|
|000002f0| 23 69 6e 63 6c 75 64 65 | 20 22 43 47 49 2e 68 22 |#include| "CGI.h"|
|00000300| 0d 23 69 6e 63 6c 75 64 | 65 20 22 45 72 72 6f 72 |.#includ|e "Error|
|00000310| 55 74 69 6c 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |Util.h".|#include|
|00000320| 20 22 45 76 65 6e 74 55 | 74 69 6c 2e 68 22 0d 23 | "EventU|til.h".#|
|00000330| 69 6e 63 6c 75 64 65 20 | 22 4c 69 73 74 53 54 41 |include |"ListSTA|
|00000340| 52 2e 68 22 0d 23 69 6e | 63 6c 75 64 65 20 22 4d |R.h".#in|clude "M|
|00000350| 65 6d 6f 72 79 55 74 69 | 6c 2e 68 22 0d 23 69 6e |emoryUti|l.h".#in|
|00000360| 63 6c 75 64 65 20 22 4d | 65 6e 75 46 75 6e 63 2e |clude "M|enuFunc.|
|00000370| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 22 50 72 6f |h".#incl|ude "Pro|
|00000380| 63 65 73 73 55 74 69 6c | 2e 68 22 0d 23 69 6e 63 |cessUtil|.h".#inc|
|00000390| 6c 75 64 65 20 22 53 70 | 6c 61 73 68 53 63 72 65 |lude "Sp|lashScre|
|000003a0| 65 6e 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |en.h".#i|nclude "|
|000003b0| 53 74 72 69 6e 67 55 74 | 69 6c 2e 68 22 0d 23 69 |StringUt|il.h".#i|
|000003c0| 6e 63 6c 75 64 65 20 22 | 56 65 72 73 69 6f 6e 2e |nclude "|Version.|
|000003d0| 68 22 0d 0d 23 69 6e 63 | 6c 75 64 65 20 22 53 74 |h"..#inc|lude "St|
|000003e0| 61 72 74 75 70 2e 68 22 | 0d 0d 0d 2f 2a 2a 2a 20 |artup.h"|.../*** |
|000003f0| 20 4c 4f 43 41 4c 20 43 | 4f 4e 53 54 41 4e 54 53 | LOCAL C|ONSTANTS|
|00000400| 20 2a 2a 2a 2f 0d 0d 23 | 64 65 66 69 6e 65 09 54 | ***/..#|define.T|
|00000410| 72 61 70 4d 61 73 6b 09 | 09 30 78 30 38 30 30 0d |rapMask.|.0x0800.|
|00000420| 23 64 65 66 69 6e 65 20 | 6b 47 65 73 74 61 6c 74 |#define |kGestalt|
|00000430| 4d 61 73 6b 09 31 4c 0d | 0d 2f 2a 20 77 69 6e 64 |Mask.1L.|./* wind|
|00000440| 6f 77 20 69 6e 66 6f 20 | 2a 2f 0d 23 64 65 66 69 |ow info |*/.#defi|
|00000450| 6e 65 09 6b 53 63 72 65 | 65 6e 42 6f 72 64 65 72 |ne.kScre|enBorder|
|00000460| 09 34 09 2f 2a 20 70 69 | 78 65 6c 73 20 2a 2f 0d |.4./* pi|xels */.|
|00000470| 23 64 65 66 69 6e 65 09 | 6b 49 63 6f 6e 53 69 7a |#define.|kIconSiz|
|00000480| 65 09 09 33 32 0d 0d 0d | 2f 2a 2a 2a 20 20 4c 4f |e..32...|/*** LO|
|00000490| 43 41 4c 20 50 52 4f 54 | 4f 54 59 50 45 53 20 2a |CAL PROT|OTYPES *|
|000004a0| 2a 2a 2f 0d 0d 73 74 61 | 74 69 63 09 76 6f 69 64 |**/..sta|tic.void|
|000004b0| 09 09 73 74 61 72 74 75 | 70 45 72 72 6f 72 73 09 |..startu|pErrors.|
|000004c0| 09 09 28 20 76 6f 69 64 | 20 29 3b 0d 73 74 61 74 |..( void| );.stat|
|000004d0| 69 63 09 76 6f 69 64 09 | 09 73 74 61 72 74 75 70 |ic.void.|.startup|
|000004e0| 47 65 73 74 61 6c 74 09 | 09 09 28 20 76 6f 69 64 |Gestalt.|..( void|
|000004f0| 20 29 3b 0d 73 74 61 74 | 69 63 09 76 6f 69 64 09 | );.stat|ic.void.|
|00000500| 09 73 74 61 72 74 75 70 | 45 76 65 6e 74 09 09 09 |.startup|Event...|
|00000510| 28 20 76 6f 69 64 20 29 | 3b 0d 73 74 61 74 69 63 |( void )|;.static|
|00000520| 09 76 6f 69 64 09 09 73 | 74 61 72 74 75 70 41 45 |.void..s|tartupAE|
|00000530| 09 09 09 09 28 20 76 6f | 69 64 20 29 3b 0d 73 74 |....( vo|id );.st|
|00000540| 61 74 69 63 09 76 6f 69 | 64 09 09 73 74 61 72 74 |atic.voi|d..start|
|00000550| 75 70 54 68 72 65 61 64 | 73 09 09 09 28 20 76 6f |upThread|s...( vo|
|00000560| 69 64 20 29 3b 0d 23 69 | 66 20 6b 43 6f 6d 70 69 |id );.#i|f kCompi|
|00000570| 6c 65 57 69 74 68 46 6f | 72 65 67 72 6f 75 6e 64 |leWithFo|reground|
|00000580| 0d 73 74 61 74 69 63 09 | 76 6f 69 64 09 09 73 74 |.static.|void..st|
|00000590| 61 72 74 75 70 4d 65 6e | 75 73 20 09 09 09 28 20 |artupMen|us ...( |
|000005a0| 76 6f 69 64 20 29 3b 0d | 73 74 61 74 69 63 09 76 |void );.|static.v|
|000005b0| 6f 69 64 09 09 73 74 61 | 72 74 75 70 57 69 6e 64 |oid..sta|rtupWind|
|000005c0| 6f 77 73 09 09 09 28 20 | 76 6f 69 64 20 29 3b 0d |ows...( |void );.|
|000005d0| 73 74 61 74 69 63 09 76 | 6f 69 64 09 09 73 74 61 |static.v|oid..sta|
|000005e0| 72 74 75 70 51 75 69 63 | 6b 44 72 61 77 09 09 28 |rtupQuic|kDraw..(|
|000005f0| 20 76 6f 69 64 20 29 3b | 0d 23 69 66 20 6b 43 6f | void );|.#if kCo|
|00000600| 6d 70 69 6c 65 57 69 74 | 68 44 72 61 67 4e 44 72 |mpileWit|hDragNDr|
|00000610| 6f 70 0d 73 74 61 74 69 | 63 09 76 6f 69 64 09 09 |op.stati|c.void..|
|00000620| 73 74 61 72 74 75 70 44 | 72 61 67 09 09 09 09 28 |startupD|rag....(|
|00000630| 20 76 6f 69 64 20 29 3b | 0d 23 65 6e 64 69 66 0d | void );|.#endif.|
|00000640| 0d 23 65 6c 73 65 0d 09 | 2f 2a 20 6d 61 6b 65 20 |.#else..|/* make |
|00000650| 74 68 65 20 69 6e 74 65 | 72 66 61 63 65 20 66 75 |the inte|rface fu|
|00000660| 6e 63 74 69 6f 6e 20 70 | 72 6f 74 6f 74 79 70 65 |nction p|rototype|
|00000670| 73 20 6e 75 6c 6c 20 2a | 2f 0d 09 23 64 65 66 69 |s null *|/..#defi|
|00000680| 6e 65 20 73 74 61 72 74 | 75 70 4d 65 6e 75 73 28 |ne start|upMenus(|
|00000690| 29 09 0d 09 23 64 65 66 | 69 6e 65 20 73 74 61 72 |)...#def|ine star|
|000006a0| 74 75 70 57 69 6e 64 6f | 77 73 28 29 09 0d 09 23 |tupWindo|ws()...#|
|000006b0| 64 65 66 69 6e 65 20 73 | 74 61 72 74 75 70 51 75 |define s|tartupQu|
|000006c0| 69 63 6b 44 72 61 77 28 | 29 09 0d 23 65 6e 64 69 |ickDraw(|)..#endi|
|000006d0| 66 09 2f 2a 20 6b 43 6f | 6d 70 69 6c 65 57 69 74 |f./* kCo|mpileWit|
|000006e0| 68 46 6f 72 65 67 72 6f | 75 6e 64 20 2a 2f 0d 09 |hForegro|und */..|
|000006f0| 0d 73 74 61 74 69 63 09 | 42 6f 6f 6c 65 61 6e 09 |.static.|Boolean.|
|00000700| 09 73 74 61 72 74 75 70 | 54 72 61 70 41 76 61 69 |.startup|TrapAvai|
|00000710| 6c 61 62 6c 65 09 28 20 | 75 6e 73 69 67 6e 65 64 |lable.( |unsigned|
|00000720| 20 6c 6f 6e 67 20 29 3b | 0d 73 74 61 74 69 63 09 | long );|.static.|
|00000730| 54 72 61 70 54 79 70 65 | 09 73 74 61 72 74 75 70 |TrapType|.startup|
|00000740| 54 72 61 70 54 79 70 65 | 09 09 09 28 20 75 6e 73 |TrapType|...( uns|
|00000750| 69 67 6e 65 64 20 6c 6f | 6e 67 20 29 3b 0d 0d 0d |igned lo|ng );...|
|00000760| 2f 2a 2a 2a 20 20 46 55 | 4e 43 54 49 4f 4e 53 20 |/*** FU|NCTIONS |
|00000770| 20 2a 2a 2a 2f 0d 0d 76 | 6f 69 64 0d 53 74 61 72 | ***/..v|oid.Star|
|00000780| 74 75 70 41 70 70 6c 69 | 63 61 74 69 6f 6e 20 28 |tupAppli|cation (|
|00000790| 20 76 6f 69 64 20 29 0d | 7b 0d 09 4f 53 45 72 72 | void ).|{..OSErr|
|000007a0| 09 74 68 65 45 72 72 3b | 0d 09 0d 09 67 53 6c 65 |.theErr;|....gSle|
|000007b0| 65 70 54 69 63 6b 73 09 | 09 3d 20 6b 53 6c 65 65 |epTicks.|.= kSlee|
|000007c0| 70 54 69 63 6b 73 3b 0d | 09 67 46 72 6f 6e 74 50 |pTicks;.|.gFrontP|
|000007d0| 72 6f 63 65 73 73 09 3d | 20 50 72 6f 63 65 73 73 |rocess.=| Process|
|000007e0| 43 75 72 72 65 6e 74 49 | 73 46 72 6f 6e 74 20 28 |CurrentI|sFront (|
|000007f0| 29 3b 0d 09 0d 09 23 69 | 66 20 6b 43 6f 6d 70 69 |);....#i|f kCompi|
|00000800| 6c 65 57 69 74 68 50 72 | 6f 63 65 73 73 46 69 6c |leWithPr|ocessFil|
|00000810| 65 53 70 65 63 0d 09 50 | 72 6f 63 65 73 73 47 65 |eSpec..P|rocessGe|
|00000820| 74 4d 79 46 53 53 70 65 | 63 20 28 20 26 67 50 72 |tMyFSSpe|c ( &gPr|
|00000830| 6f 63 65 73 73 46 53 53 | 70 65 63 20 29 3b 0d 09 |ocessFSS|pec );..|
|00000840| 23 65 6e 64 69 66 0d 09 | 0d 09 73 74 61 72 74 75 |#endif..|..startu|
|00000850| 70 45 72 72 6f 72 73 09 | 09 28 29 3b 0d 09 0d 09 |pErrors.|.();....|
|00000860| 56 65 72 73 69 6f 6e 47 | 65 74 53 68 6f 72 74 09 |VersionG|etShort.|
|00000870| 09 28 20 31 2c 20 67 56 | 65 72 73 69 6f 6e 53 74 |.( 1, gV|ersionSt|
|00000880| 72 20 29 3b 09 2f 2a 20 | 6d 75 73 74 20 62 65 20 |r );./* |must be |
|00000890| 62 65 66 6f 72 65 20 73 | 70 6c 61 73 68 20 73 63 |before s|plash sc|
|000008a0| 72 65 65 6e 20 2a 2f 0d | 09 0d 09 53 70 6c 61 73 |reen */.|...Splas|
|000008b0| 68 53 63 72 65 65 6e 43 | 72 65 61 74 65 09 28 29 |hScreenC|reate.()|
|000008c0| 3b 09 2f 2a 20 70 75 74 | 20 75 70 20 73 70 6c 61 |;./* put| up spla|
|000008d0| 73 68 20 73 63 72 65 65 | 6e 20 2a 2f 0d 0d 09 73 |sh scree|n */...s|
|000008e0| 74 61 72 74 75 70 47 65 | 73 74 61 6c 74 09 09 28 |tartupGe|stalt..(|
|000008f0| 29 3b 09 2f 2a 20 6d 75 | 73 74 20 62 65 20 62 65 |);./* mu|st be be|
|00000900| 66 6f 72 65 20 61 6c 6c | 20 4d 61 6e 61 67 65 72 |fore all| Manager|
|00000910| 20 69 6e 69 74 73 20 65 | 78 63 65 70 74 20 74 6f | inits e|xcept to|
|00000920| 6f 6c 62 6f 78 20 61 6e | 64 20 6d 65 6d 6f 72 79 |olbox an|d memory|
|00000930| 20 2a 2f 0d 09 73 74 61 | 72 74 75 70 45 76 65 6e | */..sta|rtupEven|
|00000940| 74 09 09 28 29 3b 0d 09 | 73 74 61 72 74 75 70 41 |t..();..|startupA|
|00000950| 45 09 09 09 28 29 3b 0d | 09 73 74 61 72 74 75 70 |E...();.|.startup|
|00000960| 4d 65 6e 75 73 09 09 28 | 29 3b 0d 09 73 74 61 72 |Menus..(|);..star|
|00000970| 74 75 70 54 68 72 65 61 | 64 73 09 09 28 29 3b 0d |tupThrea|ds..();.|
|00000980| 09 73 74 61 72 74 75 70 | 57 69 6e 64 6f 77 73 09 |.startup|Windows.|
|00000990| 09 28 29 3b 09 2f 2a 20 | 6d 75 73 74 20 62 65 20 |.();./* |must be |
|000009a0| 61 66 74 65 72 20 73 74 | 61 72 74 75 70 4d 65 6e |after st|artupMen|
|000009b0| 75 73 20 2a 2f 0d 09 73 | 74 61 72 74 75 70 51 75 |us */..s|tartupQu|
|000009c0| 69 63 6b 44 72 61 77 09 | 28 29 3b 0d 09 23 69 66 |ickDraw.|();..#if|
|000009d0| 20 6b 43 6f 6d 70 69 6c | 65 57 69 74 68 44 72 61 | kCompil|eWithDra|
|000009e0| 67 4e 44 72 6f 70 0d 09 | 73 74 61 72 74 75 70 44 |gNDrop..|startupD|
|000009f0| 72 61 67 09 09 09 28 29 | 3b 0d 09 23 65 6e 64 69 |rag...()|;..#endi|
|00000a00| 66 0d 09 41 62 6f 75 74 | 42 6f 78 49 6e 69 74 09 |f..About|BoxInit.|
|00000a10| 09 28 29 3b 0d 09 0d 09 | 23 69 66 20 6b 43 6f 6d |.();....|#if kCom|
|00000a20| 70 69 6c 65 57 69 74 68 | 51 75 69 74 4f 6e 4c 6f |pileWith|QuitOnLo|
|00000a30| 6e 67 49 64 6c 65 0d 09 | 67 44 6f 49 64 6c 65 51 |ngIdle..|gDoIdleQ|
|00000a40| 75 69 74 09 09 3d 20 74 | 72 75 65 3b 09 2f 2a 20 |uit..= t|rue;./* |
|00000a50| 71 75 69 74 20 61 66 74 | 65 72 20 67 69 76 65 6e |quit aft|er given|
|00000a60| 20 70 65 72 69 6f 64 20 | 6f 66 20 69 64 6c 65 20 | period |of idle |
|00000a70| 74 69 6d 65 20 2a 2f 0d | 09 67 54 69 6d 65 4c 61 |time */.|.gTimeLa|
|00000a80| 73 74 41 63 74 69 6f 6e | 20 3d 20 6e 69 6c 3b 09 |stAction| = nil;.|
|00000a90| 2f 2a 20 6e 6f 20 61 63 | 74 69 6f 6e 20 68 61 73 |/* no ac|tion has|
|00000aa0| 20 62 65 65 6e 20 70 65 | 72 66 6f 72 6d 65 64 20 | been pe|rformed |
|00000ab0| 79 65 74 20 2a 2f 0d 09 | 67 49 64 6c 65 54 69 6d |yet */..|gIdleTim|
|00000ac0| 65 54 6f 51 75 69 74 09 | 3d 20 6b 49 64 6c 65 54 |eToQuit.|= kIdleT|
|00000ad0| 69 6d 65 54 6f 51 75 69 | 74 3b 0d 09 67 44 6f 49 |imeToQui|t;..gDoI|
|00000ae0| 64 6c 65 51 75 69 74 4f | 6e 4f 70 65 6e 41 70 70 |dleQuitO|nOpenApp|
|00000af0| 09 3d 20 6b 43 6f 6d 70 | 69 6c 65 57 69 74 68 49 |.= kComp|ileWithI|
|00000b00| 64 6c 65 51 75 69 74 4f | 6e 4f 70 65 6e 41 70 70 |dleQuitO|nOpenApp|
|00000b10| 3b 0d 09 23 65 6e 64 69 | 66 0d 09 0d 09 74 68 65 |;..#endi|f....the|
|00000b20| 45 72 72 20 3d 20 49 6e | 69 74 43 47 49 55 74 69 |Err = In|itCGIUti|
|00000b30| 6c 20 28 29 3b 09 2f 2a | 20 43 47 49 20 53 70 65 |l ();./*| CGI Spe|
|00000b40| 63 69 66 69 63 20 2a 2f | 0d 09 69 66 20 28 20 74 |cific */|..if ( t|
|00000b50| 68 65 45 72 72 20 21 3d | 20 6e 6f 45 72 72 20 29 |heErr !=| noErr )|
|00000b60| 0d 09 7b 0d 09 09 45 72 | 72 6f 72 53 74 61 72 74 |..{...Er|rorStart|
|00000b70| 75 70 20 28 20 6b 65 72 | 72 53 74 61 72 74 75 70 |up ( ker|rStartup|
|00000b80| 43 47 49 20 29 3b 0d 09 | 7d 0d 09 0d 09 74 68 65 |CGI );..|}....the|
|00000b90| 45 72 72 20 3d 20 49 6e | 69 74 4c 69 73 74 53 54 |Err = In|itListST|
|00000ba0| 41 52 55 74 69 6c 20 28 | 29 3b 09 2f 2a 20 4c 69 |ARUtil (|);./* Li|
|00000bb0| 73 74 53 54 41 52 20 53 | 70 65 63 69 66 69 63 20 |stSTAR S|pecific |
|00000bc0| 2a 2f 0d 09 69 66 20 28 | 20 74 68 65 45 72 72 20 |*/..if (| theErr |
|00000bd0| 21 3d 20 6e 6f 45 72 72 | 20 29 0d 09 7b 0d 09 09 |!= noErr| )..{...|
|00000be0| 45 72 72 6f 72 53 74 61 | 72 74 75 70 20 28 20 6b |ErrorSta|rtup ( k|
|00000bf0| 65 72 72 53 74 61 72 74 | 75 70 4c 69 73 74 53 54 |errStart|upListST|
|00000c00| 41 52 20 29 3b 0d 09 7d | 0d 09 0d 09 2f 2a 20 a5 |AR );..}|..../* .|
|00000c10| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 74 | the res|ult of t|
|00000c20| 68 69 73 20 63 61 6c 6c | 20 73 68 6f 75 6c 64 20 |his call| should |
|00000c30| 62 65 20 63 68 65 63 6b | 65 64 20 74 6f 20 73 65 |be check|ed to se|
|00000c40| 65 20 77 68 65 74 68 65 | 72 0d 09 09 69 6e 69 74 |e whethe|r...init|
|00000c50| 69 61 6c 69 7a 61 74 69 | 6f 6e 20 77 61 73 20 73 |ializati|on was s|
|00000c60| 75 63 63 65 73 73 66 75 | 6c 20 2a 2f 0d 09 74 68 |uccessfu|l */..th|
|00000c70| 65 45 72 72 20 3d 20 4d | 79 53 74 61 72 74 75 70 |eErr = M|yStartup|
|00000c80| 20 28 29 3b 0d 09 69 66 | 20 28 20 74 68 65 45 72 | ();..if| ( theEr|
|00000c90| 72 20 21 3d 20 6e 6f 45 | 72 72 20 29 0d 09 7b 0d |r != noE|rr )..{.|
|00000ca0| 09 09 45 72 72 6f 72 53 | 74 61 72 74 75 70 20 28 |..ErrorS|tartup (|
|00000cb0| 20 6b 65 72 72 53 74 61 | 72 74 75 70 43 75 73 74 | kerrSta|rtupCust|
|00000cc0| 6f 6d 49 6e 69 74 20 29 | 3b 0d 09 7d 0d 09 0d 2f |omInit )|;..}.../|
|00000cd0| 2f 20 a5 20 6d 6f 76 65 | 64 20 74 6f 20 22 4d 79 |/ . move|d to "My|
|00000ce0| 48 61 6e 64 6c 65 72 73 | 2e 63 22 0d 2f 2f 09 4d |Handlers|.c".//.M|
|00000cf0| 79 43 47 49 53 74 61 72 | 74 75 70 09 09 28 29 3b |yCGIStar|tup..();|
|00000d00| 09 2f 2a 20 43 47 49 20 | 53 70 65 63 69 66 69 63 |./* CGI |Specific|
|00000d10| 20 2a 2f 0d 2f 2f 09 4d | 79 4c 69 73 74 53 54 41 | */.//.M|yListSTA|
|00000d20| 52 53 74 61 72 74 75 70 | 09 28 29 3b 09 2f 2a 20 |RStartup|.();./* |
|00000d30| 4c 69 73 74 53 54 41 52 | 20 53 70 65 63 69 66 69 |ListSTAR| Specifi|
|00000d40| 63 20 2a 2f 0d 09 0d 09 | 53 70 6c 61 73 68 53 63 |c */....|SplashSc|
|00000d50| 72 65 65 6e 44 69 73 70 | 6f 73 65 20 28 29 3b 09 |reenDisp|ose ();.|
|00000d60| 2f 2a 20 72 65 6d 6f 76 | 65 20 73 70 6c 61 73 68 |/* remov|e splash|
|00000d70| 20 73 63 72 65 65 6e 20 | 2a 2f 0d 7d 20 2f 2a 20 | screen |*/.} /* |
|00000d80| 53 74 61 72 74 75 70 41 | 70 70 6c 69 63 61 74 69 |StartupA|pplicati|
|00000d90| 6f 6e 20 2a 2f 0d 0d 0d | 2f 2a 2a 2a 20 20 49 6e |on */...|/*** In|
|00000da0| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 20 46 75 6e |itializa|tion Fun|
|00000db0| 63 74 69 6f 6e 73 20 20 | 2a 2a 2a 2f 0d 23 70 72 |ctions |***/.#pr|
|00000dc0| 61 67 6d 61 20 6d 61 72 | 6b 20 2d 0d 0d 2f 2a 20 |agma mar|k -../* |
|00000dd0| 49 6e 69 74 69 61 6c 69 | 7a 65 20 64 65 66 61 75 |Initiali|ze defau|
|00000de0| 6c 74 20 73 74 72 69 6e | 67 20 66 6f 72 20 73 79 |lt strin|g for sy|
|00000df0| 73 74 65 6d 20 65 72 72 | 6f 72 73 20 2a 2f 0d 73 |stem err|ors */.s|
|00000e00| 74 61 74 69 63 20 76 6f | 69 64 0d 73 74 61 72 74 |tatic vo|id.start|
|00000e10| 75 70 45 72 72 6f 72 73 | 20 28 20 76 6f 69 64 20 |upErrors| ( void |
|00000e20| 29 0d 7b 0d 09 53 74 72 | 69 6e 67 48 61 6e 64 6c |).{..Str|ingHandl|
|00000e30| 65 09 74 65 6d 70 53 74 | 72 3b 0d 09 0d 09 2f 2a |e.tempSt|r;..../*|
|00000e40| 20 73 65 74 20 73 79 73 | 74 65 6d 20 65 72 72 6f | set sys|tem erro|
|00000e50| 72 20 64 65 66 61 75 6c | 74 20 73 74 72 69 6e 67 |r defaul|t string|
|00000e60| 20 2a 2f 0d 09 0d 09 67 | 53 79 73 74 65 6d 45 72 | */....g|SystemEr|
|00000e70| 72 6f 72 53 74 72 09 3d | 20 28 53 74 72 69 6e 67 |rorStr.=| (String|
|00000e80| 48 61 6e 64 6c 65 29 20 | 4d 79 4e 65 77 48 61 6e |Handle) |MyNewHan|
|00000e90| 64 6c 65 20 28 20 73 69 | 7a 65 6f 66 28 53 74 72 |dle ( si|zeof(Str|
|00000ea0| 32 35 35 29 2c 20 6e 69 | 6c 20 29 3b 0d 09 0d 09 |255), ni|l );....|
|00000eb0| 69 66 20 28 20 67 53 79 | 73 74 65 6d 45 72 72 6f |if ( gSy|stemErro|
|00000ec0| 72 53 74 72 20 3d 3d 20 | 6e 69 6c 20 29 0d 09 7b |rStr == |nil )..{|
|00000ed0| 0d 09 09 72 65 74 75 72 | 6e 3b 0d 09 7d 0d 09 0d |...retur|n;..}...|
|00000ee0| 09 48 4c 6f 63 6b 48 69 | 20 28 20 28 48 61 6e 64 |.HLockHi| ( (Hand|
|00000ef0| 6c 65 29 67 53 79 73 74 | 65 6d 45 72 72 6f 72 53 |le)gSyst|emErrorS|
|00000f00| 74 72 20 29 3b 0d 09 0d | 09 74 65 6d 70 53 74 72 |tr );...|.tempStr|
|00000f10| 20 3d 20 47 65 74 53 74 | 72 69 6e 67 20 28 20 6b | = GetSt|ring ( k|
|00000f20| 72 45 72 72 53 79 73 74 | 65 6d 44 65 66 61 75 6c |rErrSyst|emDefaul|
|00000f30| 74 20 29 3b 0d 09 0d 09 | 69 66 20 28 20 74 65 6d |t );....|if ( tem|
|00000f40| 70 53 74 72 20 3d 3d 20 | 6e 69 6c 20 29 0d 09 7b |pStr == |nil )..{|
|00000f50| 0d 09 09 53 74 72 69 6e | 67 50 61 73 63 61 6c 43 |...Strin|gPascalC|
|00000f60| 6f 70 79 20 28 20 28 63 | 68 61 72 20 2a 29 6b 73 |opy ( (c|har *)ks|
|00000f70| 45 72 72 53 79 73 74 65 | 6d 44 65 66 61 75 6c 74 |ErrSyste|mDefault|
|00000f80| 2c 20 28 63 68 61 72 20 | 2a 29 28 2a 67 53 79 73 |, (char |*)(*gSys|
|00000f90| 74 65 6d 45 72 72 6f 72 | 53 74 72 29 20 29 3b 0d |temError|Str) );.|
|00000fa0| 09 7d 0d 09 65 6c 73 65 | 0d 09 7b 0d 09 09 48 4c |.}..else|..{...HL|
|00000fb0| 6f 63 6b 20 28 20 28 48 | 61 6e 64 6c 65 29 74 65 |ock ( (H|andle)te|
|00000fc0| 6d 70 53 74 72 20 29 3b | 0d 09 09 0d 09 09 53 74 |mpStr );|......St|
|00000fd0| 72 69 6e 67 50 61 73 63 | 61 6c 43 6f 70 79 20 28 |ringPasc|alCopy (|
|00000fe0| 20 28 63 68 61 72 20 2a | 29 28 2a 74 65 6d 70 53 | (char *|)(*tempS|
|00000ff0| 74 72 29 2c 20 28 63 68 | 61 72 20 2a 29 28 2a 67 |tr), (ch|ar *)(*g|
|00001000| 53 79 73 74 65 6d 45 72 | 72 6f 72 53 74 72 29 20 |SystemEr|rorStr) |
|00001010| 29 3b 0d 09 09 0d 09 09 | 48 55 6e 6c 6f 63 6b 09 |);......|HUnlock.|
|00001020| 09 09 28 20 28 48 61 6e | 64 6c 65 29 74 65 6d 70 |..( (Han|dle)temp|
|00001030| 53 74 72 20 29 3b 0d 09 | 09 52 65 6c 65 61 73 65 |Str );..|.Release|
|00001040| 52 65 73 6f 75 72 63 65 | 09 28 20 28 48 61 6e 64 |Resource|.( (Hand|
|00001050| 6c 65 29 74 65 6d 70 53 | 74 72 20 29 3b 0d 09 7d |le)tempS|tr );..}|
|00001060| 0d 09 0d 09 48 55 6e 6c | 6f 63 6b 20 28 20 28 48 |....HUnl|ock ( (H|
|00001070| 61 6e 64 6c 65 29 67 53 | 79 73 74 65 6d 45 72 72 |andle)gS|ystemErr|
|00001080| 6f 72 53 74 72 20 29 3b | 0d 7d 20 2f 2a 20 73 74 |orStr );|.} /* st|
|00001090| 61 72 74 75 70 45 72 72 | 6f 72 73 20 2a 2f 0d 0d |artupErr|ors */..|
|000010a0| 0d 2f 2a 20 44 65 74 65 | 72 6d 69 6e 65 20 69 66 |./* Dete|rmine if|
|000010b0| 20 74 68 65 20 47 65 73 | 74 61 6c 74 20 6d 61 6e | the Ges|talt man|
|000010c0| 61 67 65 72 20 69 73 20 | 61 76 61 69 6c 61 62 6c |ager is |availabl|
|000010d0| 65 20 2a 2f 0d 73 74 61 | 74 69 63 20 76 6f 69 64 |e */.sta|tic void|
|000010e0| 0d 73 74 61 72 74 75 70 | 47 65 73 74 61 6c 74 20 |.startup|Gestalt |
|000010f0| 28 20 76 6f 69 64 20 29 | 0d 7b 0d 09 42 6f 6f 6c |( void )|.{..Bool|
|00001100| 65 61 6e 09 09 67 65 73 | 74 61 6c 74 41 76 61 69 |ean..ges|taltAvai|
|00001110| 6c 3b 0d 09 0d 09 2f 2a | 20 64 65 74 65 72 6d 69 |l;..../*| determi|
|00001120| 6e 65 20 77 68 65 74 68 | 65 72 20 74 68 65 20 47 |ne wheth|er the G|
|00001130| 65 73 74 61 6c 74 20 63 | 61 6c 6c 20 69 73 20 61 |estalt c|all is a|
|00001140| 76 61 69 6c 61 62 6c 65 | 20 2a 2f 0d 09 67 65 73 |vailable| */..ges|
|00001150| 74 61 6c 74 41 76 61 69 | 6c 20 3d 20 73 74 61 72 |taltAvai|l = star|
|00001160| 74 75 70 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |tupTrapA|vailable|
|00001170| 20 28 20 5f 47 65 73 74 | 61 6c 74 20 29 3b 0d 09 | ( _Gest|alt );..|
|00001180| 0d 09 69 66 20 28 20 21 | 67 65 73 74 61 6c 74 41 |..if ( !|gestaltA|
|00001190| 76 61 69 6c 20 29 0d 09 | 7b 0d 09 09 2f 2a 20 47 |vail )..|{.../* G|
|000011a0| 65 73 74 61 6c 74 20 72 | 65 71 75 69 72 65 20 66 |estalt r|equire f|
|000011b0| 6f 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 74 |or appli|cation t|
|000011c0| 6f 20 77 6f 72 6b 2c 20 | 69 6e 66 6f 72 6d 20 74 |o work, |inform t|
|000011d0| 68 65 20 75 73 65 72 20 | 61 6e 64 20 65 78 69 74 |he user |and exit|
|000011e0| 20 2a 2f 0d 09 09 45 72 | 72 6f 72 53 74 61 72 74 | */...Er|rorStart|
|000011f0| 75 70 20 28 20 6b 65 72 | 72 53 74 61 72 74 75 70 |up ( ker|rStartup|
|00001200| 47 65 73 74 61 6c 74 20 | 29 3b 0d 09 7d 0d 7d 20 |Gestalt |);..}.} |
|00001210| 2f 2a 20 73 74 61 72 74 | 75 70 47 65 73 74 61 6c |/* start|upGestal|
|00001220| 74 20 2a 2f 0d 0d 0d 2f | 2a 20 44 65 74 65 72 6d |t */.../|* Determ|
|00001230| 69 6e 65 20 69 66 20 57 | 61 69 74 4e 65 78 74 45 |ine if W|aitNextE|
|00001240| 76 65 6e 74 20 74 72 61 | 70 20 69 73 20 61 76 61 |vent tra|p is ava|
|00001250| 69 6c 61 62 6c 65 2e 20 | 2a 2f 0d 73 74 61 74 69 |ilable. |*/.stati|
|00001260| 63 20 76 6f 69 64 0d 73 | 74 61 72 74 75 70 45 76 |c void.s|tartupEv|
|00001270| 65 6e 74 20 28 20 76 6f | 69 64 20 29 0d 7b 0d 09 |ent ( vo|id ).{..|
|00001280| 4f 53 45 72 72 09 09 74 | 68 65 45 72 72 3b 0d 09 |OSErr..t|heErr;..|
|00001290| 53 79 73 45 6e 76 52 65 | 63 09 74 68 65 53 79 73 |SysEnvRe|c.theSys|
|000012a0| 45 6e 76 3b 09 2f 2a 20 | 73 79 73 74 65 6d 20 65 |Env;./* |system e|
|000012b0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 2a 2f 0d 09 42 |nvironme|nt */..B|
|000012c0| 6f 6f 6c 65 61 6e 09 09 | 57 4e 45 41 76 61 69 6c |oolean..|WNEAvail|
|000012d0| 3b 0d 09 0d 09 2f 2a 20 | 77 68 61 74 20 61 72 65 |;..../* |what are|
|000012e0| 20 77 65 20 72 75 6e 6e | 69 6e 67 20 6f 6e 20 68 | we runn|ing on h|
|000012f0| 65 72 65 20 28 53 79 73 | 74 65 6d 20 34 2e 31 20 |ere (Sys|tem 4.1 |
|00001300| 6f 72 20 67 72 65 61 74 | 65 72 29 20 2a 2f 0d 09 |or great|er) */..|
|00001310| 74 68 65 45 72 72 20 3d | 20 53 79 73 45 6e 76 69 |theErr =| SysEnvi|
|00001320| 72 6f 6e 73 20 28 20 31 | 2c 20 26 74 68 65 53 79 |rons ( 1|, &theSy|
|00001330| 73 45 6e 76 20 29 3b 0d | 09 0d 09 69 66 20 28 20 |sEnv );.|...if ( |
|00001340| 74 68 65 45 72 72 20 21 | 3d 20 6e 6f 45 72 72 20 |theErr !|= noErr |
|00001350| 29 0d 09 7b 0d 09 09 2f | 2a 20 63 61 6e 27 74 20 |)..{.../|* can't |
|00001360| 66 69 67 75 72 65 20 6f | 75 74 20 77 68 61 74 20 |figure o|ut what |
|00001370| 74 68 65 20 73 79 73 74 | 65 6d 20 65 6e 76 69 72 |the syst|em envir|
|00001380| 6f 6e 6d 65 6e 74 20 69 | 73 2c 20 69 6e 66 6f 72 |onment i|s, infor|
|00001390| 6d 20 74 68 65 20 75 73 | 65 72 20 61 6e 64 20 65 |m the us|er and e|
|000013a0| 78 69 74 20 2a 2f 0d 09 | 09 45 72 72 6f 72 53 74 |xit */..|.ErrorSt|
|000013b0| 61 72 74 75 70 20 28 20 | 6b 65 72 72 53 74 61 72 |artup ( |kerrStar|
|000013c0| 74 75 70 53 79 73 45 6e | 76 20 29 3b 0d 09 7d 0d |tupSysEn|v );..}.|
|000013d0| 09 65 6c 73 65 0d 09 7b | 0d 09 09 2f 2a 20 69 73 |.else..{|.../* is|
|000013e0| 20 57 61 69 74 4e 65 78 | 74 45 76 65 6e 74 20 69 | WaitNex|tEvent i|
|000013f0| 6d 70 6c 65 6d 65 6e 74 | 65 64 3f 20 2d 20 66 72 |mplement|ed? - fr|
|00001400| 6f 6d 20 4d 61 63 69 6e | 74 6f 73 68 20 54 65 63 |om Macin|tosh Tec|
|00001410| 68 20 4e 6f 74 65 20 23 | 31 35 38 20 2a 2f 0d 09 |h Note #|158 */..|
|00001420| 09 69 66 20 28 20 74 68 | 65 53 79 73 45 6e 76 2e |.if ( th|eSysEnv.|
|00001430| 6d 61 63 68 69 6e 65 54 | 79 70 65 20 3e 20 65 6e |machineT|ype > en|
|00001440| 76 4d 61 63 68 55 6e 6b | 6e 6f 77 6e 20 29 0d 09 |vMachUnk|nown )..|
|00001450| 09 7b 0d 09 09 09 57 4e | 45 41 76 61 69 6c 20 3d |.{....WN|EAvail =|
|00001460| 20 4e 47 65 74 54 72 61 | 70 41 64 64 72 65 73 73 | NGetTra|pAddress|
|00001470| 28 30 78 36 30 2c 20 54 | 6f 6f 6c 54 72 61 70 29 |(0x60, T|oolTrap)|
|00001480| 20 21 3d 20 4e 47 65 74 | 54 72 61 70 41 64 64 72 | != NGet|TrapAddr|
|00001490| 65 73 73 28 30 78 39 46 | 2c 20 54 6f 6f 6c 54 72 |ess(0x9F|, ToolTr|
|000014a0| 61 70 29 3b 0d 09 09 7d | 0d 09 09 65 6c 73 65 0d |ap);...}|...else.|
|000014b0| 09 09 7b 0d 09 09 09 57 | 4e 45 41 76 61 69 6c 20 |..{....W|NEAvail |
|000014c0| 3d 20 66 61 6c 73 65 3b | 0d 09 09 7d 0d 09 7d 0d |= false;|...}..}.|
|000014d0| 09 0d 09 69 66 20 28 20 | 21 57 4e 45 41 76 61 69 |...if ( |!WNEAvai|
|000014e0| 6c 20 29 0d 09 7b 0d 09 | 09 2f 2a 20 57 61 69 74 |l )..{..|./* Wait|
|000014f0| 4e 65 78 74 45 76 65 6e | 74 20 74 72 61 70 20 69 |NextEven|t trap i|
|00001500| 73 20 6d 69 73 73 69 6e | 67 20 2d 20 63 61 6e 27 |s missin|g - can'|
|00001510| 74 20 72 75 6e 20 2a 2f | 0d 09 09 45 72 72 6f 72 |t run */|...Error|
|00001520| 53 74 61 72 74 75 70 20 | 28 20 6b 65 72 72 53 74 |Startup |( kerrSt|
|00001530| 61 72 74 75 70 57 4e 45 | 20 29 3b 0d 09 7d 0d 7d |artupWNE| );..}.}|
|00001540| 20 2f 2a 20 73 74 61 72 | 74 75 70 45 76 65 6e 74 | /* star|tupEvent|
|00001550| 20 2a 2f 0d 0d 0d 2f 2a | 20 44 65 74 65 72 6d 69 | */.../*| Determi|
|00001560| 6e 65 20 69 66 20 41 70 | 70 6c 65 20 45 76 65 6e |ne if Ap|ple Even|
|00001570| 74 20 4d 61 6e 61 67 65 | 72 20 69 73 20 70 72 65 |t Manage|r is pre|
|00001580| 73 65 6e 74 20 61 6e 64 | 20 69 6e 73 74 61 6c 6c |sent and| install|
|00001590| 20 68 61 6e 64 6c 65 72 | 73 20 2a 2f 0d 73 74 61 | handler|s */.sta|
|000015a0| 74 69 63 20 76 6f 69 64 | 0d 73 74 61 72 74 75 70 |tic void|.startup|
|000015b0| 41 45 20 28 20 76 6f 69 | 64 20 29 0d 7b 0d 09 6c |AE ( voi|d ).{..l|
|000015c0| 6f 6e 67 09 66 65 61 74 | 75 72 65 3b 0d 09 4f 53 |ong.feat|ure;..OS|
|000015d0| 45 72 72 09 74 68 65 45 | 72 72 3b 0d 09 0d 09 74 |Err.theE|rr;....t|
|000015e0| 68 65 45 72 72 20 3d 20 | 47 65 73 74 61 6c 74 20 |heErr = |Gestalt |
|000015f0| 28 20 67 65 73 74 61 6c | 74 41 70 70 6c 65 45 76 |( gestal|tAppleEv|
|00001600| 65 6e 74 73 41 74 74 72 | 2c 20 26 66 65 61 74 75 |entsAttr|, &featu|
|00001610| 72 65 20 29 3b 0d 09 69 | 66 20 28 20 28 74 68 65 |re );..i|f ( (the|
|00001620| 45 72 72 20 21 3d 20 6e | 6f 45 72 72 29 20 7c 7c |Err != n|oErr) |||
|00001630| 0d 09 09 21 28 66 65 61 | 74 75 72 65 20 26 20 28 |...!(fea|ture & (|
|00001640| 6b 47 65 73 74 61 6c 74 | 4d 61 73 6b 20 3c 3c 20 |kGestalt|Mask << |
|00001650| 67 65 73 74 61 6c 74 41 | 70 70 6c 65 45 76 65 6e |gestaltA|ppleEven|
|00001660| 74 73 50 72 65 73 65 6e | 74 29 29 20 29 0d 09 7b |tsPresen|t)) )..{|
|00001670| 0d 09 09 2f 2a 20 41 70 | 70 6c 65 20 45 76 65 6e |.../* Ap|ple Even|
|00001680| 74 73 20 6e 6f 74 20 61 | 76 61 69 6c 61 62 6c 65 |ts not a|vailable|
|00001690| 2c 20 69 6e 66 6f 72 6d | 20 74 68 65 20 75 73 65 |, inform| the use|
|000016a0| 72 20 61 6e 64 20 65 78 | 69 74 20 2a 2f 0d 09 09 |r and ex|it */...|
|000016b0| 45 72 72 6f 72 53 74 61 | 72 74 75 70 20 28 20 6b |ErrorSta|rtup ( k|
|000016c0| 65 72 72 53 74 61 72 74 | 75 70 41 70 70 6c 65 45 |errStart|upAppleE|
|000016d0| 76 65 6e 74 20 29 3b 0d | 09 7d 0d 0d 09 67 41 45 |vent );.|.}...gAE|
|000016e0| 49 64 6c 65 55 50 50 20 | 3d 20 4e 65 77 41 45 49 |IdleUPP |= NewAEI|
|000016f0| 64 6c 65 50 72 6f 63 20 | 28 20 4d 79 41 45 49 64 |dleProc |( MyAEId|
|00001700| 6c 65 46 75 6e 63 20 29 | 3b 0d 09 0d 09 74 68 65 |leFunc )|;....the|
|00001710| 45 72 72 20 3d 20 41 45 | 49 6e 73 74 61 6c 6c 48 |Err = AE|InstallH|
|00001720| 61 6e 64 6c 65 72 73 20 | 28 29 3b 0d 09 69 66 20 |andlers |();..if |
|00001730| 28 20 74 68 65 45 72 72 | 20 21 3d 20 6e 6f 45 72 |( theErr| != noEr|
|00001740| 72 20 29 0d 09 7b 0d 09 | 09 45 72 72 6f 72 53 79 |r )..{..|.ErrorSy|
|00001750| 73 74 65 6d 20 28 20 74 | 68 65 45 72 72 20 29 3b |stem ( t|heErr );|
|00001760| 0d 09 7d 0d 09 0d 2f 2f | 09 74 68 65 45 72 72 20 |..}...//|.theErr |
|00001770| 3d 20 45 76 65 6e 74 53 | 70 61 77 6e 41 45 44 69 |= EventS|pawnAEDi|
|00001780| 73 70 61 74 63 68 65 72 | 54 68 72 65 61 64 20 28 |spatcher|Thread (|
|00001790| 29 3b 0d 7d 20 2f 2a 20 | 73 74 61 72 74 75 70 41 |);.} /* |startupA|
|000017a0| 45 20 2a 2f 0d 0d 0d 2f | 2a 20 73 65 74 75 70 20 |E */.../|* setup |
|000017b0| 6d 65 6e 75 73 20 2a 2f | 0d 23 69 66 20 6b 43 6f |menus */|.#if kCo|
|000017c0| 6d 70 69 6c 65 57 69 74 | 68 46 6f 72 65 67 72 6f |mpileWit|hForegro|
|000017d0| 75 6e 64 0d 73 74 61 74 | 69 63 20 76 6f 69 64 0d |und.stat|ic void.|
|000017e0| 73 74 61 72 74 75 70 4d | 65 6e 75 73 20 28 20 76 |startupM|enus ( v|
|000017f0| 6f 69 64 20 29 0d 7b 0d | 09 48 61 6e 64 6c 65 09 |oid ).{.|.Handle.|
|00001800| 09 09 74 68 65 4d 65 6e | 75 42 61 72 3b 0d 09 0d |..theMen|uBar;...|
|00001810| 09 74 68 65 4d 65 6e 75 | 42 61 72 20 3d 20 47 65 |.theMenu|Bar = Ge|
|00001820| 74 4e 65 77 4d 42 61 72 | 20 28 20 6b 6d 4d 65 6e |tNewMBar| ( kmMen|
|00001830| 75 42 61 72 49 44 20 29 | 3b 0d 09 0d 09 69 66 20 |uBarID )|;....if |
|00001840| 28 20 74 68 65 4d 65 6e | 75 42 61 72 20 3d 3d 20 |( theMen|uBar == |
|00001850| 6e 69 6c 20 29 0d 09 7b | 0d 09 09 2f 2a 20 63 61 |nil )..{|.../* ca|
|00001860| 6e 27 74 20 6c 6f 61 64 | 20 6d 65 6e 75 20 62 61 |n't load| menu ba|
|00001870| 72 20 2a 2f 0d 09 09 45 | 72 72 6f 72 53 74 61 72 |r */...E|rrorStar|
|00001880| 74 75 70 20 28 20 6b 65 | 72 72 53 74 61 72 74 75 |tup ( ke|rrStartu|
|00001890| 70 4d 65 6e 75 20 29 3b | 0d 09 7d 0d 09 0d 09 53 |pMenu );|..}....S|
|000018a0| 65 74 4d 65 6e 75 42 61 | 72 20 28 20 74 68 65 4d |etMenuBa|r ( theM|
|000018b0| 65 6e 75 42 61 72 20 29 | 3b 0d 0d 09 67 6d 41 70 |enuBar )|;...gmAp|
|000018c0| 70 6c 65 4d 65 6e 75 09 | 3d 20 47 65 74 4d 48 61 |pleMenu.|= GetMHa|
|000018d0| 6e 64 6c 65 20 28 20 6b | 6d 41 70 70 6c 65 4d 65 |ndle ( k|mAppleMe|
|000018e0| 6e 75 49 44 20 29 3b 0d | 09 2f 2a 20 61 64 64 20 |nuID );.|./* add |
|000018f0| 22 41 70 70 6c 65 20 4d | 65 6e 75 20 49 74 65 6d |"Apple M|enu Item|
|00001900| 73 22 20 74 6f 20 74 68 | 65 20 41 70 70 6c 65 20 |s" to th|e Apple |
|00001910| 6d 65 6e 75 20 2a 2f 0d | 09 41 64 64 52 65 73 4d |menu */.|.AddResM|
|00001920| 65 6e 75 09 28 20 67 6d | 41 70 70 6c 65 4d 65 6e |enu.( gm|AppleMen|
|00001930| 75 2c 20 27 44 52 56 52 | 27 20 29 3b 0d 0d 09 67 |u, 'DRVR|' );...g|
|00001940| 6d 46 69 6c 65 4d 65 6e | 75 09 3d 20 47 65 74 4d |mFileMen|u.= GetM|
|00001950| 48 61 6e 64 6c 65 20 28 | 20 6b 6d 46 69 6c 65 4d |Handle (| kmFileM|
|00001960| 65 6e 75 49 44 20 29 3b | 0d 09 67 6d 45 64 69 74 |enuID );|..gmEdit|
|00001970| 4d 65 6e 75 09 3d 20 47 | 65 74 4d 48 61 6e 64 6c |Menu.= G|etMHandl|
|00001980| 65 20 28 20 6b 6d 45 64 | 69 74 4d 65 6e 75 49 44 |e ( kmEd|itMenuID|
|00001990| 20 29 3b 0d 09 0d 09 44 | 72 61 77 4d 65 6e 75 42 | );....D|rawMenuB|
|000019a0| 61 72 20 28 29 3b 0d 7d | 20 2f 2a 20 73 74 61 72 |ar ();.}| /* star|
|000019b0| 74 75 70 4d 65 6e 75 73 | 20 2a 2f 0d 23 65 6e 64 |tupMenus| */.#end|
|000019c0| 69 66 09 2f 2a 20 6b 43 | 6f 6d 70 69 6c 65 57 69 |if./* kC|ompileWi|
|000019d0| 74 68 46 6f 72 65 67 72 | 6f 75 6e 64 20 2a 2f 0d |thForegr|ound */.|
|000019e0| 0d 0d 2f 2a 20 64 65 74 | 65 72 6d 69 6e 65 20 69 |../* det|ermine i|
|000019f0| 66 20 74 68 72 65 61 64 | 20 6d 61 6e 61 67 65 72 |f thread| manager|
|00001a00| 20 69 73 20 61 76 61 69 | 6c 61 62 6c 65 20 2a 2f | is avai|lable */|
|00001a10| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 0d 73 74 61 |.static |void.sta|
|00001a20| 72 74 75 70 54 68 72 65 | 61 64 73 20 28 20 76 6f |rtupThre|ads ( vo|
|00001a30| 69 64 20 29 0d 7b 0d 09 | 4f 53 45 72 72 09 74 68 |id ).{..|OSErr.th|
|00001a40| 65 45 72 72 3b 0d 09 6c | 6f 6e 67 09 66 65 61 74 |eErr;..l|ong.feat|
|00001a50| 75 72 65 3b 0d 09 0d 09 | 23 69 66 20 6b 43 6f 6d |ure;....|#if kCom|
|00001a60| 70 69 6c 65 57 69 74 68 | 54 68 72 65 61 64 73 4f |pileWith|ThreadsO|
|00001a70| 70 74 69 6f 6e 61 6c 0d | 09 67 48 61 73 54 68 72 |ptional.|.gHasThr|
|00001a80| 65 61 64 4d 67 72 20 3d | 20 66 61 6c 73 65 3b 0d |eadMgr =| false;.|
|00001a90| 09 23 65 6e 64 69 66 0d | 09 0d 09 74 68 65 45 72 |.#endif.|...theEr|
|00001aa0| 72 20 3d 20 47 65 73 74 | 61 6c 74 20 28 20 67 65 |r = Gest|alt ( ge|
|00001ab0| 73 74 61 6c 74 54 68 72 | 65 61 64 4d 67 72 41 74 |staltThr|eadMgrAt|
|00001ac0| 74 72 2c 20 26 66 65 61 | 74 75 72 65 20 29 3b 0d |tr, &fea|ture );.|
|00001ad0| 09 0d 09 69 66 20 28 20 | 74 68 65 45 72 72 20 3d |...if ( |theErr =|
|00001ae0| 3d 20 6e 6f 45 72 72 20 | 29 0d 09 7b 0d 09 09 69 |= noErr |)..{...i|
|00001af0| 66 20 28 0d 09 09 09 23 | 69 66 64 65 66 20 70 6f |f (....#|ifdef po|
|00001b00| 77 65 72 63 0d 09 09 09 | 28 20 66 65 61 74 75 72 |werc....|( featur|
|00001b10| 65 20 26 20 28 31 20 3c | 3c 20 67 65 73 74 61 6c |e & (1 <|< gestal|
|00001b20| 74 54 68 72 65 61 64 73 | 4c 69 62 72 61 72 79 50 |tThreads|LibraryP|
|00001b30| 72 65 73 65 6e 74 29 20 | 29 20 26 26 0d 09 09 09 |resent) |) &&....|
|00001b40| 2f 2a 20 a5 a5 a5 20 43 | 61 6e 20 61 6e 79 62 6f |/* ... C|an anybo|
|00001b50| 64 79 20 77 68 6f 20 64 | 6f 65 73 20 50 6f 77 65 |dy who d|oes Powe|
|00001b60| 72 50 43 20 63 6f 64 65 | 20 74 65 6c 6c 20 6d 65 |rPC code| tell me|
|00001b70| 20 77 68 79 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 | why the| followi|
|00001b80| 6e 67 0d 09 09 09 09 6c | 69 6e 65 20 64 6f 65 73 |ng.....l|ine does|
|00001b90| 6e 27 74 20 77 6f 72 6b | 3f 0d 09 09 09 09 28 20 |n't work|?.....( |
|00001ba0| 28 50 74 72 29 4e 65 77 | 54 68 72 65 61 64 20 21 |(Ptr)New|Thread !|
|00001bb0| 3d 20 6b 55 6e 72 65 73 | 6f 6c 76 65 64 53 79 6d |= kUnres|olvedSym|
|00001bc0| 62 6f 6c 41 64 64 72 65 | 73 73 20 29 20 26 26 0d |bolAddre|ss ) &&.|
|00001bd0| 09 09 09 09 a5 a5 a5 20 | 2a 2f 0d 09 09 09 23 65 |....... |*/....#e|
|00001be0| 6e 64 69 66 20 2f 2a 20 | 64 65 66 20 70 6f 77 65 |ndif /* |def powe|
|00001bf0| 72 63 20 2a 2f 0d 09 09 | 09 2f 2a 20 74 68 65 20 |rc */...|./* the |
|00001c00| 66 65 61 74 75 72 65 20 | 63 68 65 63 6b 20 61 70 |feature |check ap|
|00001c10| 70 6c 69 65 73 20 74 6f | 20 62 6f 74 68 20 36 38 |plies to| both 68|
|00001c20| 4b 20 26 20 50 50 43 20 | 2a 2f 0d 09 09 09 28 20 |K & PPC |*/....( |
|00001c30| 66 65 61 74 75 72 65 20 | 26 20 28 31 20 3c 3c 20 |feature |& (1 << |
|00001c40| 67 65 73 74 61 6c 74 54 | 68 72 65 61 64 4d 67 72 |gestaltT|hreadMgr|
|00001c50| 50 72 65 73 65 6e 74 29 | 20 29 20 29 0d 09 09 7b |Present)| ) )...{|
|00001c60| 0d 09 09 09 23 69 66 20 | 6b 43 6f 6d 70 69 6c 65 |....#if |kCompile|
|00001c70| 57 69 74 68 54 68 72 65 | 61 64 73 4f 70 74 69 6f |WithThre|adsOptio|
|00001c80| 6e 61 6c 0d 09 09 09 67 | 48 61 73 54 68 72 65 61 |nal....g|HasThrea|
|00001c90| 64 4d 67 72 20 3d 20 74 | 72 75 65 3b 0d 09 09 09 |dMgr = t|rue;....|
|00001ca0| 23 65 6e 64 69 66 0d 09 | 09 09 0d 09 09 09 2f 2a |#endif..|....../*|
|00001cb0| 20 6e 6f 20 73 75 62 20 | 74 68 72 65 61 64 73 20 | no sub |threads |
|00001cc0| 72 75 6e 6e 69 6e 67 20 | 79 65 74 20 2a 2f 0d 09 |running |yet */..|
|00001cd0| 09 09 23 69 66 20 6b 53 | 74 61 72 74 75 70 54 68 |..#if kS|tartupTh|
|00001ce0| 72 65 61 64 73 50 72 65 | 61 6c 6c 6f 63 61 74 65 |readsPre|allocate|
|00001cf0| 20 3e 20 6e 69 6c 0d 09 | 09 09 67 54 68 72 65 61 | > nil..|..gThrea|
|00001d00| 64 54 6f 74 61 6c 20 3d | 20 6e 69 6c 3b 0d 09 09 |dTotal =| nil;...|
|00001d10| 09 2f 2a 20 6e 6f 20 73 | 6c 65 65 70 69 6e 67 20 |./* no s|leeping |
|00001d20| 74 68 72 65 61 64 20 79 | 65 74 20 2a 2f 0d 2f 2f |thread y|et */.//|
|00001d30| 09 09 09 67 54 68 72 65 | 61 64 53 6c 65 65 70 65 |...gThre|adSleepe|
|00001d40| 72 49 6e 64 65 78 20 3d | 20 30 3b 0d 09 09 09 67 |rIndex =| 0;....g|
|00001d50| 54 68 72 65 61 64 53 6c | 65 65 70 65 72 20 3d 20 |ThreadSl|eeper = |
|00001d60| 6e 69 6c 3b 0d 09 09 09 | 23 65 6e 64 69 66 0d 09 |nil;....|#endif..|
|00001d70| 09 09 0d 09 09 09 2f 2a | 20 64 65 74 65 72 6d 69 |....../*| determi|
|00001d80| 6e 65 20 74 68 65 20 69 | 64 20 6f 66 20 74 68 65 |ne the i|d of the|
|00001d90| 20 6d 61 69 6e 20 28 63 | 75 72 72 65 6e 74 29 20 | main (c|urrent) |
|00001da0| 74 68 72 65 61 64 20 2a | 2f 0d 09 09 09 47 65 74 |thread *|/....Get|
|00001db0| 43 75 72 72 65 6e 74 54 | 68 72 65 61 64 20 28 20 |CurrentT|hread ( |
|00001dc0| 26 67 54 68 72 65 61 64 | 4d 61 69 6e 20 29 3b 0d |&gThread|Main );.|
|00001dd0| 09 09 09 0d 09 09 09 23 | 69 66 20 6b 53 74 61 72 |.......#|if kStar|
|00001de0| 74 75 70 54 68 72 65 61 | 64 73 50 72 65 61 6c 6c |tupThrea|dsPreall|
|00001df0| 6f 63 61 74 65 20 3e 20 | 6e 69 6c 0d 09 09 09 2f |ocate > |nil..../|
|00001e00| 2a 20 70 72 65 2d 61 6c | 6c 6f 63 61 74 65 20 74 |* pre-al|locate t|
|00001e10| 68 65 20 72 65 71 75 69 | 72 65 64 20 6e 75 6d 62 |he requi|red numb|
|00001e20| 65 72 20 6f 66 20 74 68 | 72 65 61 64 73 20 2a 2f |er of th|reads */|
|00001e30| 0d 09 09 09 43 72 65 61 | 74 65 54 68 72 65 61 64 |....Crea|teThread|
|00001e40| 50 6f 6f 6c 20 28 20 6b | 43 6f 6f 70 65 72 61 74 |Pool ( k|Cooperat|
|00001e50| 69 76 65 54 68 72 65 61 | 64 2c 20 6b 53 74 61 72 |iveThrea|d, kStar|
|00001e60| 74 75 70 54 68 72 65 61 | 64 73 50 72 65 61 6c 6c |tupThrea|dsPreall|
|00001e70| 6f 63 61 74 65 2c 20 6e | 69 6c 20 29 3b 0d 09 09 |ocate, n|il );...|
|00001e80| 09 23 65 6e 64 69 66 0d | 09 09 7d 0d 09 7d 0d 7d |.#endif.|..}..}.}|
|00001e90| 20 2f 2a 20 73 74 61 72 | 74 75 70 54 68 72 65 61 | /* star|tupThrea|
|00001ea0| 64 73 20 2a 2f 0d 0d 0d | 2f 2a 20 44 65 74 65 72 |ds */...|/* Deter|
|00001eb0| 6d 69 6e 65 20 74 68 65 | 20 73 70 61 63 65 20 61 |mine the| space a|
|00001ec0| 76 61 69 6c 61 62 6c 65 | 20 6f 6e 20 74 68 65 20 |vailable| on the |
|00001ed0| 6d 61 69 6e 20 61 6e 64 | 20 6f 74 68 65 72 20 6d |main and| other m|
|00001ee0| 6f 6e 69 74 6f 72 73 20 | 2a 2f 0d 23 69 66 20 6b |onitors |*/.#if k|
|00001ef0| 43 6f 6d 70 69 6c 65 57 | 69 74 68 46 6f 72 65 67 |CompileW|ithForeg|
|00001f00| 72 6f 75 6e 64 0d 73 74 | 61 74 69 63 20 76 6f 69 |round.st|atic voi|
|00001f10| 64 0d 73 74 61 72 74 75 | 70 57 69 6e 64 6f 77 73 |d.startu|pWindows|
|00001f20| 20 28 20 76 6f 69 64 20 | 29 0d 7b 0d 09 73 68 6f | ( void |).{..sho|
|00001f30| 72 74 20 09 09 72 65 73 | 57 3b 0d 09 73 68 6f 72 |rt ..res|W;..shor|
|00001f40| 74 09 09 72 65 73 48 3b | 0d 09 73 68 6f 72 74 09 |t..resH;|..short.|
|00001f50| 09 6d 65 6e 75 42 61 72 | 48 65 69 67 68 74 3b 0d |.menuBar|Height;.|
|00001f60| 09 52 67 6e 48 61 6e 64 | 6c 65 09 67 72 61 79 52 |.RgnHand|le.grayR|
|00001f70| 67 6e 48 64 6c 3b 0d 09 | 52 65 63 74 09 09 67 72 |gnHdl;..|Rect..gr|
|00001f80| 61 79 52 67 6e 42 6f 75 | 6e 64 73 3b 0d 09 0d 09 |ayRgnBou|nds;....|
|00001f90| 2f 2a 20 67 65 74 20 73 | 63 72 65 65 6e 20 64 69 |/* get s|creen di|
|00001fa0| 6d 65 6e 73 69 6f 6e 73 | 20 2a 2f 0d 09 72 65 73 |mensions| */..res|
|00001fb0| 57 20 3d 20 71 64 2e 73 | 63 72 65 65 6e 42 69 74 |W = qd.s|creenBit|
|00001fc0| 73 2e 62 6f 75 6e 64 73 | 2e 72 69 67 68 74 20 20 |s.bounds|.right |
|00001fd0| 2d 20 71 64 2e 73 63 72 | 65 65 6e 42 69 74 73 2e |- qd.scr|eenBits.|
|00001fe0| 62 6f 75 6e 64 73 2e 6c | 65 66 74 3b 0d 09 72 65 |bounds.l|eft;..re|
|00001ff0| 73 48 20 3d 20 71 64 2e | 73 63 72 65 65 6e 42 69 |sH = qd.|screenBi|
|00002000| 74 73 2e 62 6f 75 6e 64 | 73 2e 62 6f 74 74 6f 6d |ts.bound|s.bottom|
|00002010| 20 2d 20 71 64 2e 73 63 | 72 65 65 6e 42 69 74 73 | - qd.sc|reenBits|
|00002020| 2e 62 6f 75 6e 64 73 2e | 74 6f 70 3b 0d 09 0d 09 |.bounds.|top;....|
|00002030| 6d 65 6e 75 42 61 72 48 | 65 69 67 68 74 20 3d 20 |menuBarH|eight = |
|00002040| 4c 4d 47 65 74 4d 42 61 | 72 48 65 69 67 68 74 20 |LMGetMBa|rHeight |
|00002050| 28 29 3b 0d 09 0d 09 2f | 2a 20 67 53 63 72 65 65 |();..../|* gScree|
|00002060| 6e 52 65 63 74 20 69 73 | 20 74 68 65 20 73 69 7a |nRect is| the siz|
|00002070| 65 20 6f 66 20 74 68 65 | 20 6d 61 69 6e 20 73 63 |e of the| main sc|
|00002080| 72 65 65 6e 2c 20 69 6e | 73 65 74 20 62 79 20 61 |reen, in|set by a|
|00002090| 20 6d 61 72 67 69 6e 20 | 2a 2f 0d 09 53 65 74 52 | margin |*/..SetR|
|000020a0| 65 63 74 20 28 20 26 67 | 53 63 72 65 65 6e 52 65 |ect ( &g|ScreenRe|
|000020b0| 63 74 2c 20 6b 53 63 72 | 65 65 6e 42 6f 72 64 65 |ct, kScr|eenBorde|
|000020c0| 72 2c 20 6d 65 6e 75 42 | 61 72 48 65 69 67 68 74 |r, menuB|arHeight|
|000020d0| 20 2b 20 6b 53 63 72 65 | 65 6e 42 6f 72 64 65 72 | + kScre|enBorder|
|000020e0| 2c 20 0d 09 09 72 65 73 | 57 20 2d 20 6b 53 63 72 |, ...res|W - kScr|
|000020f0| 65 65 6e 42 6f 72 64 65 | 72 2c 20 72 65 73 48 20 |eenBorde|r, resH |
|00002100| 2d 20 6b 53 63 72 65 65 | 6e 42 6f 72 64 65 72 20 |- kScree|nBorder |
|00002110| 29 3b 0d 09 09 0d 09 2f | 2a 20 67 65 74 20 65 6e |);...../|* get en|
|00002120| 74 69 72 65 20 67 72 61 | 79 20 72 67 6e 20 72 65 |tire gra|y rgn re|
|00002130| 63 74 20 28 74 68 65 20 | 73 69 7a 65 20 6f 66 20 |ct (the |size of |
|00002140| 61 6c 6c 20 6d 6f 6e 69 | 74 6f 72 73 29 20 2a 2f |all moni|tors) */|
|00002150| 0d 09 67 72 61 79 52 67 | 6e 48 64 6c 09 09 3d 20 |..grayRg|nHdl..= |
|00002160| 47 65 74 47 72 61 79 52 | 67 6e 20 28 29 3b 09 09 |GetGrayR|gn ();..|
|00002170| 09 2f 2a 20 6b 6e 6f 77 | 6e 20 61 73 20 74 68 65 |./* know|n as the|
|00002180| 20 27 67 72 61 79 20 72 | 65 67 69 6f 6e 27 20 2a | 'gray r|egion' *|
|00002190| 2f 0d 09 67 72 61 79 52 | 67 6e 42 6f 75 6e 64 73 |/..grayR|gnBounds|
|000021a0| 09 3d 20 28 2a 67 72 61 | 79 52 67 6e 48 64 6c 29 |.= (*gra|yRgnHdl)|
|000021b0| 2d 3e 72 67 6e 42 42 6f | 78 3b 09 2f 2a 20 74 68 |->rgnBBo|x;./* th|
|000021c0| 65 20 62 6f 75 6e 64 69 | 6e 67 20 62 6f 78 20 66 |e boundi|ng box f|
|000021d0| 6f 72 20 74 68 65 20 72 | 65 67 69 6f 6e 20 2a 2f |or the r|egion */|
|000021e0| 0d 09 0d 09 72 65 73 57 | 20 3d 20 67 72 61 79 52 |....resW| = grayR|
|000021f0| 67 6e 42 6f 75 6e 64 73 | 2e 72 69 67 68 74 20 20 |gnBounds|.right |
|00002200| 2d 20 67 72 61 79 52 67 | 6e 42 6f 75 6e 64 73 2e |- grayRg|nBounds.|
|00002210| 6c 65 66 74 3b 0d 09 72 | 65 73 48 20 3d 20 67 72 |left;..r|esH = gr|
|00002220| 61 79 52 67 6e 42 6f 75 | 6e 64 73 2e 62 6f 74 74 |ayRgnBou|nds.bott|
|00002230| 6f 6d 20 2d 20 67 72 61 | 79 52 67 6e 42 6f 75 6e |om - gra|yRgnBoun|
|00002240| 64 73 2e 74 6f 70 3b 0d | 09 0d 09 2f 2a 20 74 68 |ds.top;.|.../* th|
|00002250| 69 73 20 72 65 63 74 20 | 65 6e 63 6f 6d 70 61 73 |is rect |encompas|
|00002260| 73 65 73 20 61 6c 6c 20 | 6f 66 20 74 68 65 20 6d |ses all |of the m|
|00002270| 6f 6e 69 74 6f 72 20 64 | 65 73 6b 74 6f 70 20 73 |onitor d|esktop s|
|00002280| 70 61 63 65 2c 0d 09 09 | 6d 69 6e 75 73 20 74 68 |pace,...|minus th|
|00002290| 65 20 6d 65 6e 75 20 62 | 61 72 20 61 6e 64 20 69 |e menu b|ar and i|
|000022a0| 6e 73 65 74 20 62 79 20 | 61 20 6d 61 72 67 69 6e |nset by |a margin|
|000022b0| 2e 20 57 65 27 6c 6c 20 | 75 73 65 20 74 68 69 73 |. We'll |use this|
|000022c0| 0d 09 09 72 65 63 74 61 | 6e 67 6c 65 20 74 6f 20 |...recta|ngle to |
|000022d0| 6c 69 6d 69 74 20 64 72 | 61 67 67 69 6e 67 20 61 |limit dr|agging a|
|000022e0| 6e 64 20 72 65 73 69 7a | 69 6e 67 20 77 69 6e 64 |nd resiz|ing wind|
|000022f0| 6f 77 73 20 2a 2f 0d 09 | 53 65 74 52 65 63 74 20 |ows */..|SetRect |
|00002300| 28 20 26 67 47 72 61 79 | 52 67 6e 52 65 63 74 2c |( &gGray|RgnRect,|
|00002310| 0d 09 09 2f 2a 20 6c 65 | 66 74 20 2a 2f 09 09 6b |.../* le|ft */..k|
|00002320| 53 63 72 65 65 6e 42 6f | 72 64 65 72 2c 0d 09 09 |ScreenBo|rder,...|
|00002330| 2f 2a 20 74 6f 70 20 2a | 2f 09 09 6d 65 6e 75 42 |/* top *|/..menuB|
|00002340| 61 72 48 65 69 67 68 74 | 20 2b 20 6b 53 63 72 65 |arHeight| + kScre|
|00002350| 65 6e 42 6f 72 64 65 72 | 2c 20 0d 09 09 2f 2a 20 |enBorder|, .../* |
|00002360| 72 69 67 68 74 20 2a 2f | 09 09 72 65 73 57 20 2d |right */|..resW -|
|00002370| 20 6b 53 63 72 65 65 6e | 42 6f 72 64 65 72 2c 0d | kScreen|Border,.|
|00002380| 09 09 2f 2a 20 62 6f 74 | 74 6f 6d 20 2a 2f 09 72 |../* bot|tom */.r|
|00002390| 65 73 48 20 2d 20 6b 53 | 63 72 65 65 6e 42 6f 72 |esH - kS|creenBor|
|000023a0| 64 65 72 20 29 3b 0d 7d | 20 2f 2a 20 73 74 61 72 |der );.}| /* star|
|000023b0| 74 75 70 57 69 6e 64 6f | 77 73 20 2a 2f 0d 23 65 |tupWindo|ws */.#e|
|000023c0| 6e 64 69 66 09 2f 2a 20 | 6b 43 6f 6d 70 69 6c 65 |ndif./* |kCompile|
|000023d0| 57 69 74 68 46 6f 72 65 | 67 72 6f 75 6e 64 20 2a |WithFore|ground *|
|000023e0| 2f 0d 0d 0d 2f 2a 20 51 | 75 69 63 6b 44 72 61 77 |/.../* Q|uickDraw|
|000023f0| 20 2d 20 47 72 61 70 68 | 69 63 73 20 2a 2f 0d 23 | - Graph|ics */.#|
|00002400| 69 66 20 6b 43 6f 6d 70 | 69 6c 65 57 69 74 68 46 |if kComp|ileWithF|
|00002410| 6f 72 65 67 72 6f 75 6e | 64 0d 73 74 61 74 69 63 |oregroun|d.static|
|00002420| 20 76 6f 69 64 0d 73 74 | 61 72 74 75 70 51 75 69 | void.st|artupQui|
|00002430| 63 6b 44 72 61 77 20 28 | 20 76 6f 69 64 20 29 0d |ckDraw (| void ).|
|00002440| 7b 0d 09 4f 53 45 72 72 | 09 74 68 65 45 72 72 3b |{..OSErr|.theErr;|
|00002450| 0d 09 6c 6f 6e 67 09 66 | 65 61 74 75 72 65 3b 0d |..long.f|eature;.|
|00002460| 09 6c 6f 6e 67 09 76 65 | 72 73 69 6f 6e 3b 0d 09 |.long.ve|rsion;..|
|00002470| 0d 09 67 48 61 73 43 6f | 6c 6f 72 51 44 20 3d 20 |..gHasCo|lorQD = |
|00002480| 66 61 6c 73 65 3b 0d 09 | 0d 09 74 68 65 45 72 72 |false;..|..theErr|
|00002490| 20 3d 20 47 65 73 74 61 | 6c 74 20 28 20 67 65 73 | = Gesta|lt ( ges|
|000024a0| 74 61 6c 74 51 75 69 63 | 6b 64 72 61 77 46 65 61 |taltQuic|kdrawFea|
|000024b0| 74 75 72 65 73 2c 20 26 | 66 65 61 74 75 72 65 20 |tures, &|feature |
|000024c0| 29 3b 0d 09 0d 09 69 66 | 20 28 20 74 68 65 45 72 |);....if| ( theEr|
|000024d0| 72 20 3d 3d 20 6e 6f 45 | 72 72 20 29 0d 09 7b 0d |r == noE|rr )..{.|
|000024e0| 09 09 74 68 65 45 72 72 | 20 3d 20 47 65 73 74 61 |..theErr| = Gesta|
|000024f0| 6c 74 20 28 20 67 65 73 | 74 61 6c 74 51 75 69 63 |lt ( ges|taltQuic|
|00002500| 6b 64 72 61 77 56 65 72 | 73 69 6f 6e 2c 20 26 76 |kdrawVer|sion, &v|
|00002510| 65 72 73 69 6f 6e 20 29 | 3b 0d 09 7d 0d 09 0d 09 |ersion )|;..}....|
|00002520| 69 66 20 28 20 28 74 68 | 65 45 72 72 20 3d 3d 20 |if ( (th|eErr == |
|00002530| 6e 6f 45 72 72 29 20 26 | 26 0d 09 09 28 28 66 65 |noErr) &|&...((fe|
|00002540| 61 74 75 72 65 20 26 20 | 28 6b 47 65 73 74 61 6c |ature & |(kGestal|
|00002550| 74 4d 61 73 6b 20 3c 3c | 20 67 65 73 74 61 6c 74 |tMask <<| gestalt|
|00002560| 48 61 73 43 6f 6c 6f 72 | 29 29 20 21 3d 20 6e 69 |HasColor|)) != ni|
|00002570| 6c 29 20 26 26 0d 09 09 | 28 76 65 72 73 69 6f 6e |l) &&...|(version|
|00002580| 20 3e 3d 20 67 65 73 74 | 61 6c 74 38 42 69 74 51 | >= gest|alt8BitQ|
|00002590| 44 29 20 29 0d 09 7b 0d | 09 09 67 48 61 73 43 6f |D) )..{.|..gHasCo|
|000025a0| 6c 6f 72 51 44 20 3d 20 | 74 72 75 65 3b 0d 09 7d |lorQD = |true;..}|
|000025b0| 0d 7d 20 2f 2a 20 73 74 | 61 72 74 75 70 51 75 69 |.} /* st|artupQui|
|000025c0| 63 6b 44 72 61 77 20 2a | 2f 0d 23 65 6e 64 69 66 |ckDraw *|/.#endif|
|000025d0| 09 2f 2a 20 6b 43 6f 6d | 70 69 6c 65 57 69 74 68 |./* kCom|pileWith|
|000025e0| 46 6f 72 65 67 72 6f 75 | 6e 64 20 2a 2f 0d 0d 0d |Foregrou|nd */...|
|000025f0| 2f 2a 20 44 72 61 67 20 | 4d 61 6e 61 67 65 72 20 |/* Drag |Manager |
|00002600| 2d 20 69 6e 74 65 72 61 | 70 70 6c 69 63 61 74 69 |- intera|pplicati|
|00002610| 6f 6e 20 64 72 61 67 27 | 6e 27 64 72 6f 70 20 2a |on drag'|n'drop *|
|00002620| 2f 0d 23 69 66 20 6b 43 | 6f 6d 70 69 6c 65 57 69 |/.#if kC|ompileWi|
|00002630| 74 68 44 72 61 67 4e 44 | 72 6f 70 0d 73 74 61 74 |thDragND|rop.stat|
|00002640| 69 63 20 76 6f 69 64 0d | 73 74 61 72 74 75 70 44 |ic void.|startupD|
|00002650| 72 61 67 20 28 20 76 6f | 69 64 20 29 0d 7b 0d 09 |rag ( vo|id ).{..|
|00002660| 6c 6f 6e 67 09 66 65 61 | 74 75 72 65 3b 0d 09 4f |long.fea|ture;..O|
|00002670| 53 45 72 72 09 74 68 65 | 45 72 72 3b 0d 09 0d 09 |SErr.the|Err;....|
|00002680| 74 68 65 45 72 72 20 3d | 20 47 65 73 74 61 6c 74 |theErr =| Gestalt|
|00002690| 20 28 20 67 65 73 74 61 | 6c 74 44 72 61 67 4d 67 | ( gesta|ltDragMg|
|000026a0| 72 41 74 74 72 2c 20 26 | 66 65 61 74 75 72 65 20 |rAttr, &|feature |
|000026b0| 29 3b 0d 09 0d 09 69 66 | 20 28 20 28 74 68 65 45 |);....if| ( (theE|
|000026c0| 72 72 20 3d 3d 20 6e 6f | 45 72 72 29 20 26 26 0d |rr == no|Err) &&.|
|000026d0| 09 09 28 66 65 61 74 75 | 72 65 20 26 20 28 6b 47 |..(featu|re & (kG|
|000026e0| 65 73 74 61 6c 74 4d 61 | 73 6b 20 3c 3c 20 67 65 |estaltMa|sk << ge|
|000026f0| 73 74 61 6c 74 44 72 61 | 67 4d 67 72 50 72 65 73 |staltDra|gMgrPres|
|00002700| 65 6e 74 29 29 20 29 0d | 09 7b 0d 09 09 67 48 61 |ent)) ).|.{...gHa|
|00002710| 73 44 72 61 67 4e 44 72 | 6f 70 20 3d 20 74 72 75 |sDragNDr|op = tru|
|00002720| 65 3b 0d 09 7d 0d 09 65 | 6c 73 65 0d 09 7b 0d 09 |e;..}..e|lse..{..|
|00002730| 09 67 48 61 73 44 72 61 | 67 4e 44 72 6f 70 20 3d |.gHasDra|gNDrop =|
|00002740| 20 66 61 6c 73 65 3b 0d | 09 7d 0d 7d 20 2f 2a 20 | false;.|.}.} /* |
|00002750| 73 74 61 72 74 75 70 41 | 45 20 2a 2f 0d 23 65 6e |startupA|E */.#en|
|00002760| 64 69 66 0d 0d 0d 23 70 | 72 61 67 6d 61 20 6d 61 |dif...#p|ragma ma|
|00002770| 72 6b 20 2d 0d 0d 2f 2a | 20 44 65 74 65 72 6d 69 |rk -../*| Determi|
|00002780| 6e 65 20 69 66 20 61 20 | 74 72 61 70 20 69 73 20 |ne if a |trap is |
|00002790| 61 76 61 69 6c 61 62 6c | 65 20 2a 2f 0d 73 74 61 |availabl|e */.sta|
|000027a0| 74 69 63 20 42 6f 6f 6c | 65 61 6e 0d 73 74 61 72 |tic Bool|ean.star|
|000027b0| 74 75 70 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |tupTrapA|vailable|
|000027c0| 20 28 20 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 | ( unsig|ned long|
|000027d0| 20 74 72 61 70 20 29 0d | 7b 0d 09 55 6e 69 76 65 | trap ).|{..Unive|
|000027e0| 72 73 61 6c 50 72 6f 63 | 50 74 72 09 74 68 65 49 |rsalProc|Ptr.theI|
|000027f0| 6e 69 74 47 72 61 66 41 | 64 64 72 3b 0d 09 55 6e |nitGrafA|ddr;..Un|
|00002800| 69 76 65 72 73 61 6c 50 | 72 6f 63 50 74 72 09 74 |iversalP|rocPtr.t|
|00002810| 68 65 41 41 36 45 41 64 | 64 72 3b 0d 09 42 6f 6f |heAA6EAd|dr;..Boo|
|00002820| 6c 65 61 6e 09 09 09 09 | 74 72 61 70 41 64 64 72 |lean....|trapAddr|
|00002830| 4d 61 74 63 68 3b 0d 09 | 75 6e 73 69 67 6e 65 64 |Match;..|unsigned|
|00002840| 20 6c 6f 6e 67 09 09 6e | 75 6d 54 6f 6f 6c 42 6f | long..n|umToolBo|
|00002850| 78 54 72 61 70 73 3b 0d | 09 54 72 61 70 54 79 70 |xTraps;.|.TrapTyp|
|00002860| 65 09 09 09 74 68 65 54 | 72 61 70 54 79 70 65 3b |e...theT|rapType;|
|00002870| 0d 09 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 09 |..unsign|ed long.|
|00002880| 09 74 68 65 54 72 61 70 | 4d 61 73 6b 65 64 3b 0d |.theTrap|Masked;.|
|00002890| 09 0d 09 74 68 65 49 6e | 69 74 47 72 61 66 41 64 |...theIn|itGrafAd|
|000028a0| 64 72 09 3d 20 4e 47 65 | 74 54 72 61 70 41 64 64 |dr.= NGe|tTrapAdd|
|000028b0| 72 65 73 73 20 28 20 5f | 49 6e 69 74 47 72 61 66 |ress ( _|InitGraf|
|000028c0| 2c 20 54 6f 6f 6c 54 72 | 61 70 20 29 3b 0d 09 74 |, ToolTr|ap );..t|
|000028d0| 68 65 41 41 36 45 41 64 | 64 72 09 09 3d 20 4e 47 |heAA6EAd|dr..= NG|
|000028e0| 65 74 54 72 61 70 41 64 | 64 72 65 73 73 20 28 20 |etTrapAd|dress ( |
|000028f0| 30 78 41 41 36 45 2c 20 | 54 6f 6f 6c 54 72 61 70 |0xAA6E, |ToolTrap|
|00002900| 20 29 3b 0d 09 74 72 61 | 70 41 64 64 72 4d 61 74 | );..tra|pAddrMat|
|00002910| 63 68 09 3d 20 74 68 65 | 49 6e 69 74 47 72 61 66 |ch.= the|InitGraf|
|00002920| 41 64 64 72 20 3d 3d 20 | 74 68 65 41 41 36 45 41 |Addr == |theAA6EA|
|00002930| 64 64 72 3b 0d 09 0d 09 | 69 66 20 28 20 74 72 61 |ddr;....|if ( tra|
|00002940| 70 41 64 64 72 4d 61 74 | 63 68 20 29 0d 09 7b 0d |pAddrMat|ch )..{.|
|00002950| 09 09 6e 75 6d 54 6f 6f | 6c 42 6f 78 54 72 61 70 |..numToo|lBoxTrap|
|00002960| 73 20 3d 20 30 78 32 30 | 30 3b 0d 09 7d 0d 09 65 |s = 0x20|0;..}..e|
|00002970| 6c 73 65 0d 09 7b 0d 09 | 09 6e 75 6d 54 6f 6f 6c |lse..{..|.numTool|
|00002980| 42 6f 78 54 72 61 70 73 | 20 3d 20 30 78 34 30 30 |BoxTraps| = 0x400|
|00002990| 3b 0d 09 7d 0d 09 0d 09 | 74 68 65 54 72 61 70 54 |;..}....|theTrapT|
|000029a0| 79 70 65 20 3d 20 73 74 | 61 72 74 75 70 54 72 61 |ype = st|artupTra|
|000029b0| 70 54 79 70 65 20 28 20 | 74 72 61 70 20 29 3b 0d |pType ( |trap );.|
|000029c0| 09 69 66 20 28 20 74 68 | 65 54 72 61 70 54 79 70 |.if ( th|eTrapTyp|
|000029d0| 65 20 3d 3d 20 54 6f 6f | 6c 54 72 61 70 20 29 0d |e == Too|lTrap ).|
|000029e0| 09 7b 0d 09 09 74 68 65 | 54 72 61 70 4d 61 73 6b |.{...the|TrapMask|
|000029f0| 65 64 20 3d 20 74 72 61 | 70 20 26 20 30 78 30 37 |ed = tra|p & 0x07|
|00002a00| 46 46 3b 0d 09 09 69 66 | 20 28 20 74 68 65 54 72 |FF;...if| ( theTr|
|00002a10| 61 70 4d 61 73 6b 65 64 | 20 3e 3d 20 6e 75 6d 54 |apMasked| >= numT|
|00002a20| 6f 6f 6c 42 6f 78 54 72 | 61 70 73 20 29 0d 09 09 |oolBoxTr|aps )...|
|00002a30| 7b 0d 09 09 09 72 65 74 | 75 72 6e 20 66 61 6c 73 |{....ret|urn fals|
|00002a40| 65 3b 0d 09 09 7d 0d 09 | 7d 0d 09 0d 09 72 65 74 |e;...}..|}....ret|
|00002a50| 75 72 6e 20 4e 47 65 74 | 54 72 61 70 41 64 64 72 |urn NGet|TrapAddr|
|00002a60| 65 73 73 20 28 20 5f 55 | 6e 69 6d 70 6c 65 6d 65 |ess ( _U|nimpleme|
|00002a70| 6e 74 65 64 2c 20 54 6f | 6f 6c 54 72 61 70 20 29 |nted, To|olTrap )|
|00002a80| 20 21 3d 0d 09 09 09 4e | 47 65 74 54 72 61 70 41 | !=....N|GetTrapA|
|00002a90| 64 64 72 65 73 73 20 28 | 20 74 72 61 70 2c 20 74 |ddress (| trap, t|
|00002aa0| 68 65 54 72 61 70 54 79 | 70 65 20 29 3b 0d 09 0d |heTrapTy|pe );...|
|00002ab0| 2f 2f 09 69 66 20 28 20 | 74 68 65 54 72 61 70 54 |//.if ( |theTrapT|
|00002ac0| 79 70 65 20 3d 3d 20 54 | 6f 6f 6c 54 72 61 70 20 |ype == T|oolTrap |
|00002ad0| 29 0d 2f 2f 09 7b 0d 2f | 2f 09 09 74 68 65 54 72 |).//.{./|/..theTr|
|00002ae0| 61 70 4d 61 73 6b 65 64 | 20 3d 20 74 72 61 70 20 |apMasked| = trap |
|00002af0| 26 20 30 78 30 37 46 46 | 3b 09 2f 2a 20 6d 61 73 |& 0x07FF|;./* mas|
|00002b00| 6b 20 6f 66 66 20 62 69 | 74 73 20 66 72 6f 6d 20 |k off bi|ts from |
|00002b10| 74 72 61 70 20 2a 2f 0d | 09 09 0d 2f 2f 09 09 69 |trap */.|...//..i|
|00002b20| 66 20 28 20 74 68 65 54 | 72 61 70 4d 61 73 6b 65 |f ( theT|rapMaske|
|00002b30| 64 20 3e 3d 20 6e 75 6d | 54 6f 6f 6c 42 6f 78 54 |d >= num|ToolBoxT|
|00002b40| 72 61 70 73 20 29 0d 2f | 2f 09 09 7b 0d 2f 2f 09 |raps )./|/..{.//.|
|00002b50| 09 09 74 68 65 54 72 61 | 70 4d 61 73 6b 65 64 20 |..theTra|pMasked |
|00002b60| 3d 20 5f 55 6e 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |= _Unimp|lemented|
|00002b70| 3b 0d 2f 2f 09 09 7d 0d | 2f 2f 09 7d 0d 09 0d 2f |;.//..}.|//.}.../|
|00002b80| 2f 09 72 65 74 75 72 6e | 20 28 20 4e 47 65 74 54 |/.return| ( NGetT|
|00002b90| 72 61 70 41 64 64 72 65 | 73 73 28 74 68 65 54 72 |rapAddre|ss(theTr|
|00002ba0| 61 70 4d 61 73 6b 65 64 | 2c 20 74 68 65 54 72 61 |apMasked|, theTra|
|00002bb0| 70 54 79 70 65 29 0d 2f | 2f 09 09 21 3d 20 4e 47 |pType)./|/..!= NG|
|00002bc0| 65 74 54 72 61 70 41 64 | 64 72 65 73 73 28 5f 55 |etTrapAd|dress(_U|
|00002bd0| 6e 69 6d 70 6c 65 6d 65 | 6e 74 65 64 2c 20 54 6f |nimpleme|nted, To|
|00002be0| 6f 6c 54 72 61 70 29 20 | 29 3b 0d 7d 20 2f 2a 20 |olTrap) |);.} /* |
|00002bf0| 73 74 61 72 74 75 70 54 | 72 61 70 41 76 61 69 6c |startupT|rapAvail|
|00002c00| 61 62 6c 65 20 2a 2f 0d | 0d 0d 2f 2a 20 64 65 74 |able */.|../* det|
|00002c10| 65 72 6d 69 6e 65 20 74 | 68 65 20 74 79 70 65 20 |ermine t|he type |
|00002c20| 6f 66 20 74 68 65 20 74 | 72 61 70 20 2a 2f 0d 73 |of the t|rap */.s|
|00002c30| 74 61 74 69 63 20 54 72 | 61 70 54 79 70 65 0d 73 |tatic Tr|apType.s|
|00002c40| 74 61 72 74 75 70 54 72 | 61 70 54 79 70 65 20 28 |tartupTr|apType (|
|00002c50| 20 75 6e 73 69 67 6e 65 | 64 20 6c 6f 6e 67 20 74 | unsigne|d long t|
|00002c60| 68 65 54 72 61 70 20 29 | 0d 7b 0d 09 2f 2a 20 4f |heTrap )|.{../* O|
|00002c70| 53 20 74 72 61 70 73 20 | 73 74 61 72 74 20 77 69 |S traps |start wi|
|00002c80| 74 68 20 41 30 2c 20 54 | 6f 6f 6c 20 77 69 74 68 |th A0, T|ool with|
|00002c90| 20 41 38 20 6f 72 20 41 | 41 2e 20 2a 2f 0d 09 69 | A8 or A|A. */..i|
|00002ca0| 66 20 28 20 28 74 68 65 | 54 72 61 70 20 26 20 30 |f ( (the|Trap & 0|
|00002cb0| 78 30 38 30 30 29 20 3d | 3d 20 6e 69 6c 20 29 0d |x0800) =|= nil ).|
|00002cc0| 09 7b 0d 09 09 72 65 74 | 75 72 6e 20 4f 53 54 72 |.{...ret|urn OSTr|
|00002cd0| 61 70 3b 0d 09 7d 0d 09 | 65 6c 73 65 0d 09 7b 0d |ap;..}..|else..{.|
|00002ce0| 09 09 72 65 74 75 72 6e | 20 54 6f 6f 6c 54 72 61 |..return| ToolTra|
|00002cf0| 70 3b 0d 09 7d 0d 7d 20 | 2f 2a 20 73 74 61 72 74 |p;..}.} |/* start|
|00002d00| 75 70 54 72 61 70 54 79 | 70 65 20 2a 2f 0d 0d 0d |upTrapTy|pe */...|
|00002d10| 2f 2a 2a 2a 2a 2a 20 20 | 45 4f 46 20 20 2a 2a 2a |/***** |EOF ***|
|00002d20| 2a 2a 2f 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |**/.....|........|
|00002d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d80| 00 00 01 00 00 00 01 74 | 00 00 00 74 00 00 00 52 |.......t|...t...R|
|00002d90| b4 94 4f 00 0c 8e 00 00 | 01 30 00 0b 9f 80 2d 00 |..O.....|.0....-.|
|00002da0| 00 80 00 00 00 bc 28 0b | 7e b4 eb ff 7f c6 77 f7 |......(.|~.....w.|
|00002db0| 09 53 74 61 72 74 75 70 | 2e 63 02 00 00 00 54 45 |.Startup|.c....TE|
|00002dc0| 58 54 43 57 49 45 00 04 | 00 00 00 00 00 00 00 00 |XTCWIE..|........|
|00002dd0| 00 00 54 45 58 54 43 57 | 49 45 00 04 00 00 00 00 |..TEXTCW|IE......|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 ac 1c 4b bd 00 00 | 00 00 00 00 01 c6 4f 00 |....K...|......O.|
|00002e00| 90 94 6c 00 00 94 8c 00 | 04 70 04 04 18 70 04 04 |..l.....|.p...p..|
|00002e10| 20 95 95 00 c8 9c ec 60 | 00 80 00 00 00 95 55 00 | ......`|......U.|
|00002e20| 00 9c ea 50 00 80 00 00 | 00 94 2c 00 04 94 4a 23 |...P....|..,...J#|
|00002e30| 38 30 00 08 08 94 2c 00 | 28 94 4a 23 34 30 00 08 |80....,.|(.J#40..|
|00002e40| 08 94 2c 00 10 94 4a 23 | 34 30 00 08 08 94 2c 00 |..,...J#|40....,.|
|00002e50| 0c 94 4a 3d b4 30 00 08 | 08 94 2c 00 08 94 4a 3d |..J=.0..|..,...J=|
|00002e60| b8 30 00 08 08 94 75 00 | c8 9c e3 18 00 80 00 00 |.0....u.|........|
|00002e70| 00 14 20 01 2c 94 43 00 | 1c 9d e1 10 00 80 2d 00 |.. .,.C.|......-.|
|00002e80| 00 00 00 1c 01 01 ff ff | ff ff ff ff 00 00 06 40 |........|.......@|
|00002e90| 00 01 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ea0| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ec0| 00 00 00 00 00 00 00 03 | 00 04 00 57 00 03 01 d0 |........|...W....|
|00002ed0| 02 42 00 57 00 03 01 d0 | 02 42 ad 2d ca 97 00 00 |.B.W....|.B.-....|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 00 04 |........|........|
|00002ef0| 00 01 00 01 00 00 01 00 | 00 00 01 74 00 00 00 74 |........|...t...t|
|00002f00| 00 00 00 52 00 fc cb ec | 1d 04 00 00 00 1c 00 52 |...R....|.......R|
|00002f10| 00 01 4d 50 53 52 00 01 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00002f20| 00 2a 27 10 ff ff 00 00 | 00 00 00 00 00 00 03 ed |.*'.....|........|
|00002f30| ff ff 00 00 00 20 00 00 | 00 00 03 f0 ff ff 00 00 |..... ..|........|
|00002f40| 00 6c 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.l......|........|
|00002f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+